package cn.micro.system.manage.entity;
import cn.micro.system.manage.common.vaildate.ValidateGroup;
import cn.micro.system.manage.entity.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 类型信息
 * </p>
 *
 * @author wr
 * @since 2024-01-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AssetDimTypeInfo extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 类型编号
     */
    @NotEmpty(message = "类型编号不能为空",groups = ValidateGroup.add.class)
    private String code;

    /**
     * 类型名称
     */
    @NotEmpty(message = "类型名称不能为空",groups = ValidateGroup.add.class)
    private String name;

    /**
     * 一级类别
     */
    @NotNull(message = "父类别不能为空",groups = ValidateGroup.add.class)
    private String parentId;

    /**
     * 创建者ID
     */
    private Long createBy;

    @TableField(exist = false)
    private List<AssetDimTypeInfo> children;

    @TableField(exist = false)
    private String parentName;



    public static final String ID = "id";

    public static final String CODE = "code";

    public static final String NAME = "name";

    public static final String PARENT_ID = "parent_id";

    public static final String CREATE_BY = "create_by";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String IS_DELETED = "is_deleted";

}
